The present invention relates to input sampling and more particularly, to sampling an alternating current (AC) input.
Detecting the presence of an alternating current (AC) signal with digital equipment is much more difficult than merely determining if a direct current (DC) voltage level is present on an input line. Apparatus and techniques for detecting the presence of an AC signal, or stated another wayxe2x80x94detecting the state of an AC switch, have typically included complicated sensing, filtering, and calculating circuitry and procedures.
Because an AC signal has periods in which its voltage level would be detected as a xe2x80x9c0xe2x80x9d or logic low, simply sampling the AC signal periodically is not an option because a number of false negatives will occur even if an AC signal is present. One solution is to try to perform the sampling of the AC signal only while the signal is at or near its peak. However, to do so would require synchronization between the AC signal""s frequency and the operating clock of the digital sampling equipment. Especially for an AC signal such as the standard residential AC power signal, the variability of the timing of the AC power signal will cause apparent phase shifting with any digital sampling equipment operating with more precise clock timing. Thus, even if the frequency of the AC signal is known and the first sampling of the AC signal occurs at a peak, the drift of the AC signal will eventually cause sampling to occur at times other than the AC signal peaks.
Adding peak detection circuitry or zero-crossing circuitry, which increases the complexity and cost of the sampling device, is one solution to ensure that the AC signal is sampled only at its peaks.
Currently, there is an unmet need for digital sampling methods and devices that detect the state of an AC switch while minimizing external filtering and conditioning components and that are insensitive to phase skewing between the AC signal and an operating clock.
The present invention addresses and meets these and other needs by pre-filtering an AC line signal to generate a trigger for sampling an AC signal, and filtering the sampled AC signal in such a manner so as to provide an adjustable hysteresis when determining whether or not the sampled signal is present and so as to provide immunity from false determinations.
In particular, one aspect of the present invention relates to a method for detecting the presence of one or more AC signals on a respective line. According to this aspect of the invention, for each of the particular AC signals and their respective line, a trigger signal is received that corresponds to a trough or a peak of the particular AC signal; the respective line is sampled to generate a binary value; and this generated binary value is combined with previously generated binary values for the respective line. Based on the combination of binary values, a determination is made whether the particular AC signal is present on the respective line.
Another aspect of the present invention relates to a method for providing a trigger signal that is synchronized with an AC signal being sensed. According to this aspect of the invention, a first line connected with the AC signal is sensed to determine if its state corresponds to logical HIGH or logical LOW. If the state corresponds to LOW, then a first counter is incremented but only if doing so will not make it exceed a certain value. If, however, the state corresponds to HIGH, then a second counter is incremented but only if doing so will not make it exceed the certain value. Finally, when both the first and second counters are equal and they also equal that certain value, the trigger signal is generated.
A still further aspect of the present invention relates to a device that detects the state of an AC switch. According to this aspect of the invention, the device includes an input that is connected with an input line and this input line is switchably connected with an AC signal through the AC switch. The device also includes circuitry for generating a trigger signal that corresponds to a trough or peak of the AC signal; circuitry for sensing a current logical level at the first input; and a memory that stores a combination of this current sensed level as well as previously sensed logical levels. Furthermore, this device includes a comparator that compares the combination of logical levels with a threshold to determine if the AC signal is present on the input line. This determination is analogous to determining the state of the AC switch.
Still other objects and advantages of the present invention will become readily apparent from the following detailed description, simply by way of illustration of the best mode contemplated of carrying out the invention. As will be realized, the invention is capable of other and different embodiments and its several details are capable of modifications in various obvious respects, all without departing from the invention. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive.